<?php
class service_uri{
	static public function getCategoryUri($cateID){
		$cateDao = new DaoCategory();
		$cate = $cateDao->getOne("id='$cateID'");
		$url="";
		if(!empty($cate)){
			if($cate['typeID']==service_type::PRODUCT){
				$url = url('product/list?cateID='.$cate['id']);
			}elseif($cate['typeID']==service_type::NEWS){
				$url = url('news/index?cateID='.$cate['id']);
			}
		}
		return $url;
	}
	static public function getPageUri($pageID){
		$pageDao = new DaoPage();
		$page = $pageDao->getOne("id='$pageID'");
		$url = "";
		if(!empty($page)){
			$url = url('page/index?id='.$pageID);
		}
		return $url;
	}
	static public function getProductUri($productID){
		$productDao = new DaoProduct();
		$p = $productDao->getOne("id='$productID'");
		$url = "";
		if(!empty($p)){
			$url = url('product/detail?id='.$p['id']);
		}
		return $url;
	}
	static public function getNewsUri($newsID){
		$newsDao = new DaoNews();
		$news = $newsDao->getOne("id='$newsID'");
		$url = "";
		if(!empty($news)){
			$url = url('news/detail?id='.$news['id']);
		}
		return $url;
	}
	static public function getBannerUri(){
		return url('banner?type='.service_type::BANNER);
	}
	static public function getSlideUri(){
		return url('banner?type='.service_type::SLIDE);
	}
	static public function getMenuUri(){
		return url('menu');
	}
	static public function getLinksUri(){
		return url('links');
	}
	static public function getCompanyUri(){
		return url('setting/company');
	}
}
?>
